﻿using System;
using System.Collections.Generic;

using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Media;

namespace AALib.Audio
{
    public class AudioManager : GameComponent
    {

        //holds a musicManager and soundManager
        //loads all sounds in its init-function (through smaller divided functions in the 'Load Sound Functions' - region)

        #region Fields

        private SoundManager m_soundManager = null;
        private MusicManager m_musicManager = null;

        #endregion

        #region Properties

        public SoundManager Soundmanager
        {
            get { return m_soundManager; }
        }

        public MusicManager Musicmanager
        {
            get { return m_musicManager; }
        }

        #endregion

        #region Inits

        public AudioManager(Game p_game)
            : base(p_game)
        {
            m_soundManager = new SoundManager(p_game);
            m_musicManager = new MusicManager(p_game);
            LoadTest();
        }

        public void Update(GameTime p_gameTime)
        {
            m_musicManager.Update(p_gameTime);
            m_soundManager.Update(p_gameTime);
        }

        #endregion

        #region Load Sound functions

        private void LoadTest()
        {
            m_soundManager.LoadSound("button");
            m_soundManager.LoadSound("fart8");
            m_soundManager.LoadSound("fart-wav-3");
            m_soundManager.LoadSound("fart-wav4");
        }

        private void LoadGameMusic()
        {
        }

        private void LoadMiscMusic()
        {
        }


        private void LoadFeedbackSounds()
        {
        }

        #endregion

    }
}
